﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using TongYI_Lingma_UWP_.Pages;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x804 上介绍了“空白页”项模板

namespace TongYI_Lingma_UWP_
{
    /// <summary>
    /// 可用于自身或导航至 Frame 内部的空白页。
    /// </summary>
    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();
            MainFrame.Navigate(typeof(CommentPage));
            
        }

        private void NavigationView_SelectionChanged(NavigationView sender,NavigationViewSelectionChangedEventArgs args)
        {
            if (args.SelectedItemContainer is NavigationViewItem selectedItem)
            {                
                switch (selectedItem.Name)
                {
                    case "Comment":
                        MainFrame.Navigate(typeof(CommentPage));
                        break;
                    case "Help":
                        MainFrame.Navigate(typeof(HelpPage));
                        break;
                    case "MoreDevice":
                        MainFrame.Navigate(typeof(MoreDevicePage));
                        break;
                    case "Setting":
                        MainFrame.Navigate(typeof(SettingPage));
                        break;
                    //default:
                    //    MainFrame.Navigate(typeof(CommentPage));
                    //    break;
                }
            }
        }
    }
}
